import service from '..'

export function getBanner () {
  return service({
    method: 'GET',
    url: 'banner?type=2'
  })
}
export function getMusicList () {
  return service({
    method: 'GET',
    url: '/personalized?limit=10'
  })
}
export function getMusicSearch (date) {
  return service({
    method: 'GET',
    url: `/cloudsearch?keywords=${date}`
  })
}
export function getLoginKey () {
  return service({
    method: 'GET',
    url: `/login/qr/key?timerstamp=${Date.now()}`,
    withCredentials: true,
  })
}
export function createLogin (key) {
  return service({
    method: 'GET',
    url: `/login/qr/create?key=${key}&qrimg=true&timerstamp=${Date.now()}`,
    withCredentials: true,
  })
}
export function getLoginMessage (key) {
  return service({
    method: 'GET',
    url: `/login/qr/check?key=${key}&timerstamp=${Date.now()}`,
    withCredentials: true,
  })
}

export function getLoginStatus () {
  return service({
    method: 'GET',
    url: `/login/status?timerstamp=${Date.now()}`,
    withCredentials: true
  })
}
export function logout () {
  return service({
    method: 'GET',
    url: `/logout`,
  })
}